package cn.wang.service.Impl;


import cn.wang.dao.Impl.UserDaoImpl;
import cn.wang.dao.UserDao;
import cn.wang.pojo.User;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 用户业务类，实现对user功能的业务管理
 */
@Service("userService")
public class UserServiceImpl implements UserService {
    private static final Logger logger = Logger.getLogger(UserServiceImpl.class);
    @Autowired
    private UserDao dao;

    
    public UserServiceImpl(UserDaoImpl userDao) {
        this.dao =userDao;
    }

    public void save(User user) {
        logger.info("添加用户"+user.getRealName());
        dao.save(user);
    }

    public void setDao(UserDao dao) {
        this.dao = dao;
    }
}
